package com.gxl.butt.utils;

import java.io.IOException;
import java.util.Properties;

/**
 * Created by guoxiaolin on 2018/7/13.
 */
public class PropertiesOperator {

    // 1。使用java.util.Properties 类的load()方法
    public static String  getApplication_Properties_Field(String field) throws IOException {
        Properties properties = new Properties();
        // 使用ClassLoader加载properties配置文件生成对应的输入流
        properties.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("application.properties"));
        //获取key对应的value值
        return properties.getProperty(field);
    }

}
